package com.daqian.chance.example.dynamic.datasource.modules.db1.controller;

import com.daqian.chance.common.base.BaseController;
import com.daqian.chance.core.rest.RestResult;
import com.daqian.chance.example.dynamic.datasource.modules.db1.po.dto.MemberDTO;
import com.daqian.chance.example.dynamic.datasource.modules.db1.service.IMemberService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 用户-信息 前端控制器
 * </p>
 * @author daqian
 * @since 2019-07-25
 */
@RestController
@RequestMapping("/member")
public class MemberController extends BaseController {

    @Autowired
    private IMemberService iMemberService;

    /**
     * 分页查询 用户-信息
     * @author daqian
     */
    @GetMapping("page")
    public RestResult page(MemberDTO memberDTO) {
        return RestResult.ok(iMemberService.page(memberDTO));
    }

    @GetMapping("test1")
    public RestResult test1() {
        iMemberService.step2();
        return RestResult.ok();
    }

}
